const { successData, sendCode } = require("@/utils/r/result");
const roleService = require("@/server/role");

const role = {
  //角色列表树形
  async GetTreeList(req, res) {
    successData(res, await roleService.GetTreeList(req.query));
  },
  async SaveOrUpdate(req, res) {
    sendCode(res, await roleService.SaveOrUpdate(req.body));
  },
  async Delete(req, res) {
    sendCode(res, await roleService.Delete(req.body));
  },
};

module.exports = role;
